package progeny;

public class Allele {
	final Gene a;
	final Gene b;
	
	public Allele(Gene a, Gene b){
		this.a = a;
		this.b = b;
	}
	
	public Allele(){
		this(null, null);
	}
	
	public Gene getDominant(){
		if (a.dominantOver(b) >= 0)return a;
		return b;
	}
	
	public Gene getRandom(){
		if (Math.random() > .5)return a;
		return b;
	}
	
	public String toString(){
		return a.toString()+b.toString();
	}
	
	public String getDominantPhenotype(){
		if (a.dominantOver(b)>0)return a.toString();
		return b.toString();
	}
	
	public String getCharacteristic(){
		if (a.dominantOver(b) > 0)return a.getCharacteristic();
		return b.getCharacteristic();
	}
}
